package cn.edu.zzuli.nothinglink.controller;


import cn.edu.zzuli.nothinglink.entity.R;
import cn.edu.zzuli.nothinglink.service.WorkSubmitRecordService;
import com.alibaba.fastjson.JSONObject;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author suzyyy
 * @since 2021-04-08
 */
@RestController
@RequestMapping("/work-record")
public class WorkSubmitRecordController {

    @Autowired
    WorkSubmitRecordService workSubmitRecordService;


    @PostMapping("/correct")
    public R correct(@RequestBody JSONObject json) {
        if (json.get("workSubmitId") == null || json.get("score") == null)
            return R.error().add("error", "请检查参数");
        return workSubmitRecordService.correctWorkScore(json);
    }

}

